package cn.kgc.ffzw.day24;

import java.util.Scanner;

public class HomeWork {
    public static void main(String[] args) {
        String str="长亭外 古道边 芳草碧连天 晚风拂柳笛声残 夕阳山外山";

        System.out.println(str.replace(" ","\n"));

        System.out.println("请输入一句话");
        String string=new Scanner(System.in).next();
        System.out.println("请输入要查的字");
        String string1=new Scanner(System.in).next();
        String [] num=string.split(string1);
        System.out.println("共有"+(num.length-1)+"个"+string1);
    }
}
